﻿@{
    Layout = null;
    decimal balance = ViewBag.balance;
}
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>个人中心</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="format-detection" content="telphone=no, email=no">
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <meta name="msapplication-tap-highlight" content="no">
    <link rel="stylesheet" type="text/css" href="~/Content/css/reset.css" />
    <link rel="stylesheet" type="text/css" href="~/Content/css/gelunbu.css" />
    <link href="~/Scripts/mescroll/mescroll.css" rel="stylesheet" />
</head>
<body style="background: #F0F0F0;">
    <div class="header" style="height: 64px;">
        <a class="back" href="javascript:history.back();"></a>
    </div>
    <div class="mescroll" id="mescroll">
        <div class="profitTop">
            <p>我的分润</p>
            <div class="mun">
                <span class="fn28">@balance.ToString("f2")</span> <em class="fn12">CNY</em>
            </div>
        </div>

        <div class="profit">
            <!-- <div class="top">
                分润： <em class="fn28 col-yellow">10.00</em> <em class="fn12">CNY</em>
            </div> -->
            <div class="content">
                    <div class="box-box box-tou">
                        <div class="box-a">
                            商品
                        </div>
                        <div class="box-a">
                            分润
                        </div>
                        <div class="box-a">
                            时间
                        </div>
                    </div>
                    <div id="bill_detail">

                    </div>
                </div>
            </div>
        </div>
        <script type="text/javascript" src="~/Content/js/jquery-3.2.1.min.js"></script>
        <script src="~/Scripts/mescroll/mescroll.min.js"></script>
        <script type="text/javascript">
            $(function () {
                //创建MeScroll对象,内部已默认开启下拉刷新,自动执行up.callback,重置列表数据;
                var mescroll = new MeScroll("mescroll", {
                    down: {
                        auto: false,
                        callback: function (mescroll) {
                            //mescroll.resetUpScroll(); //下拉刷新的回调,默认重置上拉加载列表为第一页
                            location.reload();
                        },
                    },
                    up: {
                        callback: getListData, //上拉回调,此处可简写; 相当于 callback: function (page) { getListData(page); }
                        clearEmptyId: "bill_detail", //1.下拉刷新时会自动先清空此列表,再加入数据; 2.无任何数据时会在此列表自动提示空
                        isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
                        noMoreSize: 3, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看
                        htmlNodata: '<p class="upwarp-nodata">--没有更多数据了 --</p >',
                        empty: {
                            //列表第一页无任何数据时,显示的空提示布局; 需配置warpId或clearEmptyId才生效;
                            //warpId:null, //父布局的id; 如果此项有值,将不使用clearEmptyId的值;
                            icon: "", //图标,默认null
                            tip: "亲,没有您要找的交易~", //提示
                            //						btntext: "去逛逛 >", //按钮,默认""
                            //						btnClick: function(){//点击按钮的回调,默认null
                            //							alert("点击了按钮,具体逻辑自行实现");
                            //						}
                        },
                        toTop: { //配置回到顶部按钮
                            src: "/content/c2c/img/toup.png", //默认滚动到1000px显示,可配置offset修改
                            /*  html: "<p>^<br/>顶部<p>", *///标签内容,默认null; 如果同时设置了src,则优先取src
                            offset: 500
                        }
                    }
                });
                /*联网加载列表数据  page = {num:1, size:10}; num:当前页 从1开始, size:每页数据条数 */

                function getListData(page) {
                    console.log("page.num=" + page.num + ", page.size=" + page.size);
                    $.ajax({
                        type: 'post',
                        url: '/User/_Profit',
                        data: { page: page.num, size: page.size },
                        success: function (response) {
                            var paged = $(response).siblings("page");
                            var rows = Number.parseInt(paged.attr("rows"));
                            var total = Number.parseInt(paged.attr("total_result"));
                            mescroll.endBySize(rows, total);
                            if (paged.length == 1) {

                                $("#bill_detail").append($(response));
                                $('#bill_detail page').remove();
                            }

                        },
                        error: function (e) {
                            //联网失败的回调,隐藏下拉刷新和上拉加载的状态
                            mescroll.endErr();
                        }
                    });
                }
            });
        </script>
</body>
</html>
<style>
    .box-box {
        display: -webkit-box;
        line-height: 20px;
    }

    .box-a {
        -webkit-box-flex: 3;
        box-sizing: border-box;
        text-align: center;
        padding:10px 0;
        line-height:18px;
        width: 33%;
        overflow: hidden;
        word-wrap: break-word;
        word-break: normal;
    }
    .box-tou{
        border-bottom: 1px solid #dcdcdc;
    }
</style>


